<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_dialog = 1;
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-lr-10">
<form name="myform" id="myform" action="" method="post">
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
			<th width="60"><?php echo L('sort')?></th>
			<th width="40">ID</th>
			<th><?php echo L('hot_content')?></th>
			<th width='120'><?php echo L('hot_count')?></th>
			<th width='120' align="center"><?php echo L('inputtime')?></th>
			<th width='120' align="center">上次编辑者</th>
			<th width="180" align="center"><?php echo L('operations_manage')?></th>
		</tr>
	</thead>
<tbody>
<?php
if(!empty($list)){
	foreach($list as $info){
		?>
	<tr>
		<td align="center"><input type="checkbox"
			name="id[]" value="<?php echo $info['id']?>"></td>
		<td align='center'><input name='listorders[<?php echo $info['id'];?>]' type='text' size='3' value='<?php echo $info['listorder'];?>' class='input-text-c'></td>
		<td align="center"><?php echo $info['id'];?></td>
		<td align="center"><?php echo $info['content'];?></td>
		<td align="center"><?php echo $info['count'];?></td>
		<td align="center"><?php echo substr($info['update_time'],0,10);?></td>
		<td align="center"><?php echo $adminInfo[$info['updated_by']];?></td>
		<td align="center">
			<a href="###"
			onclick="edit(<?php echo $info['id']?>, '<?php echo new_addslashes($info['subject'])?>')"
			title="<?php echo L('edit')?>"><?php echo L('edit')?></a> | <a
			href='?m=admin&c=hot&a=del&id=<?php echo new_addslashes($info['id'])?>'
			onClick="return confirm('<?php echo L('vote_confirm_del')?>')"><?php echo L('delete')?></a>
		</td>
	</tr>
	<?php
	}
} else {
	echo "<tr><td colspan='8' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>";
}
?>
</tbody>
</table>
<div class="btn"><a href="#"
	onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('selected_all')?></a>/<a
	href="#"
	onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a>
	<input type="button" class="button" value="<?php echo L('listorder');?>" onclick="myform.action='?m=admin&c=hot&a=listorder&dosubmit=1&steps=<?php echo $steps;?>';myform.submit();"/>
<input type="button" class="button" value="<?php echo L('delete');?>" onclick="myform.action='?m=admin&c=hot&a=del&dosubmit=1&steps=<?php echo $steps;?>';return confirm_delete('<?php echo L('vote_confirm_del')?>')"/>&nbsp;&nbsp;</div>
<div id="pages"><?php echo $pages?></div>
</form>
</div>
<script type="text/javascript">
function confirm_delete(){
	if(confirm('<?php echo L('vote_confirm_del', array('message' => L('selected')));?>')) $('#myform').submit();
}
function edit(id, name) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'<?php echo L('edit')?> '+name+' ',id:'edit',iframe:'?m=admin&c=hot&a=edit&id='+id,width:'700',height:'150'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function statistics(id, name) {                                                                                                         
	window.top.art.dialog({id:'statistics'}).close();
	window.top.art.dialog({title:'<?php echo L('statistics')?> '+name+' ',id:'edit',iframe:'?m=vote&c=vote&a=statistics&subjectid='+id,width:'700',height:'350'}, function(){var d = window.top.art.dialog({id:'statistics'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'statistics'}).close()});
}

function call(id) {
	window.top.art.dialog({id:'call'}).close();
	window.top.art.dialog({title:'<?php echo L('vote')?><?php echo L('linkage_calling_code','','admin');?>', id:'call', iframe:'?m=vote&c=vote&a=public_call&subjectid='+id, width:'600px', height:'470px'}, function(){window.top.art.dialog({id:'call'}).close();}, function(){window.top.art.dialog({id:'call'}).close();})
}

function checkuid() {
	var ids='';
	$("input[name='subjectid[]']:checked").each(function(i, n){
		ids += $(n).val() + ',';
	});
	if(ids=='') {
		window.top.art.dialog({content:'<?php echo L('before_select_operation')?>',lock:true,width:'200',height:'50',time:1.5},function(){});
		return false;
	} else {
		myform.submit();
	}
}

</script>
</body>
</html>
